package com.css.zfzx.sjcj.modules.hddcB7_VolcanicDataTable.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcB7_VolcanicDataTable.repository.entity.HddcB7VolcanicdatatableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zhangcong
 * @date 2020-11-26
 */
public interface HddcB7VolcanicdatatableRepository extends JpaRepository<HddcB7VolcanicdatatableEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b7_volcanicdatatable  set qualityinspection_status=:s ,extends1=:str where uuid=:uuid")
    void updateStatus(String s, String str, String uuid);

    @Query(nativeQuery = true,value = "select * from hddc_b7_volcanicdatatable where is_valid=1 and (qualityinspection_status!=3 or qualityinspection_status is null) ")
    List<HddcB7VolcanicdatatableEntity> findByAll();

    HddcB7VolcanicdatatableEntity findByUuidAndIsValid(String id, String isValid);
}
